package com.heima.controller;

import com.heima.pojo.Task;
import com.heima.service.TaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api/task-service/task")
public class TaskController {

    @Autowired
    private TaskService taskService;

    @GetMapping("/taskReportInfo/{start}/{end}")
    public List<Task> taskReportInfo(@PathVariable String start,@PathVariable String end){
        log.info("获取当时工单汇总信息：{}，{}",start,end);
         List<Task> tasks = taskService.taskReportInfo(start,end);
         return tasks;
    }
    //todo
//    /userWork?userId=1&start=2024-10-21+00:00:00&end=2024-10-26+23:59:59
}
